// This snippet allows the developer to split a string in lines of fixed length (inserts a new line after a specified number of characters for the whole string).
// Snippet later on can be called as a standard function.

string testString;

testString = SplitStringAt(2, "My name is flAmingw0rm");


--------------------------------------------------------------


        /// <summary>
        /// A function that splits a string with a fixed interval
        /// of characters.
        /// </summary>
        /// <param name="number">The number of characters to be separated.</param>
        /// <param name="contents">String contents to be formatted.</param>
        /// <returns></returns>
        string SplitStringAt(int number, string contents)
        {
            if ((number == 0) || (number < 0) || (number > contents.Length))
            {
                throw new ArgumentOutOfRangeException("Number");
            }
            else
            {
                int count = 0;

                StringBuilder _string = new StringBuilder();

                foreach (char c in contents.ToCharArray())
                {
                    if (count == number)
                    {
                        count = 0;
                        _string.Append(Environment.NewLine);
                    }
                    else
                    {
                        _string.Append(c);
                        count++;
                    }
                }

                return _string.ToString();
            }